package com.imooc;

import org.junit.Test;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @Date:2021/10/17/11:35
 * @Description:
 */
public class Internet {

    @Test
    public void test01() throws UnknownHostException {

        InetAddress byName = null;
        try {
            byName = InetAddress.getByName("www.atguigu.com");
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        System.out.println("byName = " + byName);

        InetAddress localHost = InetAddress.getLocalHost();
        System.out.println("localHost = " + localHost);


    }



}
